Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numericPrecision option added to pws-current files #10

Merged
merged 2 commits into from
Mar 28, 2022
Merged

numericPrecision option added to pws-current files #10

merged 2 commits into from
Mar 28, 2022

Conversation

jimison
Copy link
Contributor

@jimison jimison commented Mar 27, 2022

Per issue #8, added numericPrecision option to allow decimal results for various values returned by the API request.

Add option for numericPrecision param in API.
Add option for numericPrecision param in API.
@johnwalicki
Copy link
Owner

@jimison - this patch looks great. Thank you!

I'm testing it. Re-reading the docs at https://ibm.co/v2PWSCC

What is your use case for extra precision?

@johnwalicki
Copy link
Owner

Valid Parameter Definitions

Parameter Name Valid Parameter Value Description
numericPrecision decimal Optional parameter.  Set to ‘decimal’ to ensure data is returned in decimal format when needed.  Will return integers if this value is not used.

@jimison
Copy link
Contributor Author

jimison commented Mar 28, 2022 via email

@johnwalicki
Copy link
Owner

Without &numericPrecision=decimal

{"temp":-1,"heatIndex":-1,"dewpt":-17,"windChill":-6,"windSpeed":14,"windGust":18,"pressure":998.71,"precipRate":0,"precipTotal":0,"elev":37}

With &numericPrecision=decimal

{"temp":-1.2,"heatIndex":-1.2,"dewpt":-16.2,"windChill":-3.9,"windSpeed":7.2,"windGust":11.1,"pressure":998.92,"precipRate":0,"precipTotal":0,"elev":36.9}

@johnwalicki
Copy link
Owner

Thanks for reading the TWC docs and adding this optional parameter.
Merging the PR
I will update the changelog, spin a new release, push it to NPM. Good reason to rebase any outdated dependencies too.

@johnwalicki
Copy link
Owner

@jimison - I am testing v0.5.0 before I npm publish
I am not seeing the expected behavior of msg.twcparams.precision overriding the node edit properties.
Holding on the release until I can debug some more.

@johnwalicki
Copy link
Owner

I've got a fix.

@jimison jimison deleted the jimison-precision branch March 28, 2022 17:49
@johnwalicki
Copy link
Owner

@jimison
Copy link
Contributor Author

jimison commented Mar 28, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants